<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>餐厅菜品信息管理</title>
	<meta name="decorator" content="default"/>
    <link href="${ctxStatic}/css/combo.select.css?v=1" rel="stylesheet">
    <script type="application/javascript" src="${ctxStatic}/js/jquery.combo.select.js?v=1"></script>
    <style>
        .combo-select{display: inline-block;}
    </style>
    <script type="text/javascript">
        $(document).ready(function() {
            $("#restaurantId").comboSelect();
        });
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			layer.load(1, {
			    shade: [0.3,'#000'] //0.1透明度的白色背景
			});
			$("#searchForm").submit();
        	return false;
        }
        <shiro:hasPermission name="dishes:restaurantDishes:edit">
		function deleteById(id){
			layer.confirm('确认要删除该餐厅菜品信息吗？', {
				btn: ['确定','取消']
			}, function(){
				window.location.href='${ctx}/dishes/restaurantDishes/delete?id='+id;
			}, function(){
				layer.msg('删除取消', {
					time: 2000 //2s后自动关闭
					 });
			});
        }
        </shiro:hasPermission>
	</script>
</head>
<body>
	<ul class="nav nav-tabs nav-tabss">
		<li class="active"><a href="${ctx}/dishes/restaurantDishes/">餐厅菜品信息列表</a></li>
		<shiro:hasPermission name="dishes:restaurantDishes:edit"><li><a href="${ctx}/dishes/restaurantDishes/form">餐厅菜品信息添加</a></li></shiro:hasPermission>
	</ul>
	<form:form id="searchForm" modelAttribute="restaurantDishes" action="${ctx}/dishes/restaurantDishes/" method="post" class="breadcrumb form-search form-inline">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
           <!-- 	<label>菜品类型：</label>
            <form:select path="dishesType" htmlEscape="false" cssClass="form-control">
	            <form:option value="0" label="普通菜品"/>
	            <form:option value="1" label="套菜"/>
            </form:select> -->

            <label>所属餐厅：</label>
            <form:select path="restaurantId" htmlEscape="false" cssClass="form-control">
                <form:option value="" label="餐厅名称"/>
                <form:options items="${restaurants}" itemLabel="name" itemValue="id"/>
            </form:select>

            <label>菜品名称：</label>
            <form:input path="name" htmlEscape="false" cssClass="form-control"/>
		&nbsp;<input id="btnSubmit" class="btn btn-sm btn-primary" type="submit" value="查询"/>
	</form:form>
	
	
	<tags:message content="${message}"/>
	
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead><tr>
            <th>菜品ID</th>
            <th>菜品名称(印尼语)</th>
            <th>菜品英文名称</th>
            <th>菜品中文名称</th>
            <th>价格</th>
            <th>优惠价格</th>
            <th>介绍(印尼语)</th>
            <th>英文介绍</th>
            <th>中文介绍</th>
            <th>单位</th>
            <th>是否特价</th>
            <th>是否新品</th>
            <th>是否缺货</th>
            <th>是否厨房制作</th>
            
			<shiro:hasPermission name="dishes:restaurantDishes:edit"><th>操作</th></shiro:hasPermission></tr></thead>
			
		<tbody>
		<c:forEach items="${page.list}" var="restaurantDishes">
			<tr>
                <td>${restaurantDishes.id}</td>
              <!-- <td>${restaurantDishes.restaurantDishesComboId}</td> -->  
                <td>${restaurantDishes.name}</td>
                <td>${restaurantDishes.englishName}</td>
                <td>${restaurantDishes.chineseName}</td>
                <td>${restaurantDishes.price}</td>
                <td>${restaurantDishes.discountPrice}</td>
                <td>${restaurantDishes.recommend}</td>
                <td>${restaurantDishes.englishRecommend}</td>
                <td>${restaurantDishes.chineseRecommend}</td>
                <td>${restaurantDishes.unit}</td>
                
                <td>
	                <c:if test="${restaurantDishes.specialPriceFlag == 1}">
					    1-是
					</c:if>
					<c:if test="${restaurantDishes.specialPriceFlag == 0}">
					    0-否
					</c:if>
                </td>
                
                <td>
	                <c:if test="${restaurantDishes.newOfferFlag == 1}">
					    1-是
					</c:if>
					<c:if test="${restaurantDishes.newOfferFlag == 0}">
					    0-否
					</c:if>
                </td>
                <td>
	                <c:if test="${restaurantDishes.stockoutFlag == 1}">
					    1-是
					</c:if>
					<c:if test="${restaurantDishes.stockoutFlag == 0}">
					    0-否
					</c:if>
                </td>
                <td>
	                <c:if test="${restaurantDishes.kitchenOfferFlag == 1}">
					    1-是
					</c:if>
					<c:if test="${restaurantDishes.kitchenOfferFlag == 0}">
					    0-否
					</c:if>
                </td> 
                
				<shiro:hasPermission name="dishes:restaurantDishes:edit"><td>
    				<a href="${ctx}/dishes/restaurantDishes/form?id=${restaurantDishes.id}">修改</a>
                    <a href="javascript:deleteById('${restaurantDishes.id}')">删除</a>
				</td></shiro:hasPermission>
			</tr>
		</c:forEach>
		
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>
